package com.train.webadmin.app.model;

import com.baomidou.mybatisplus.annotation.*;
import com.train.common.core.annotation.*;
import lombok.Data;

import java.util.Date;
import java.util.Map;

/**
 * 试卷题目关系表实体对象。
 *
 * @author xulei
 * @date 2025-03-07
 */
@Data
@TableName(value = "t_paper_quest")
public class TPaperQuest {

    /**
     * id。
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 题目id。
     */
    @TableField(value = "question_id")
    private Long questionId;

    /**
     * 试卷id。
     */
    @TableField(value = "paper_id")
    private Long paperId;

    /**
     * 创建时间。
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间。
     */
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 创建人id。
     */
    @TableField(value = "create_user_id")
    private Long createUserId;

    /**
     * 更新人id。
     */
    @TableField(value = "update_user_id")
    private Long updateUserId;

    @RelationDict(
            masterIdField = "questionId",
            slaveModelClass = TQuestionInfo.class,
            slaveIdField = "id",
            slaveNameField = "title")
    @TableField(exist = false)
    private Map<String, Object> questionIdDictMap;

    @RelationDict(
            masterIdField = "paperId",
            slaveModelClass = TPaperInfo.class,
            slaveIdField = "id",
            slaveNameField = "title")
    @TableField(exist = false)
    private Map<String, Object> paperIdDictMap;
}
